<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>产品</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<style>
		html{ padding: 10px}
	</style>
</head>
<body class="childrenBody">
<blockquote class="layui-elem-quote">编辑</blockquote>
<form class="layui-form" id="bd1">


	<div class="layui-form-item">
		<label class="layui-form-label">名称</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input newsName"  value="{$t.name}" name="name" lay-verify="required" placeholder="请输入名称">
		</div>
	</div>



	<div class="layui-form-item">
		<label class="layui-form-label">价格</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input newsName"  value="{$t.price}" name="price" lay-verify="required" placeholder="请输入价格">
		</div>
	</div>

	


    


	<input type="hidden" name="tid" value="{$t.id}">
		<input type="hidden" name="pid" value="{:input('pid')}">




	


	
	
	
	<div class="layui-form-item">
		<div class="layui-input-block">
			<button class="layui-btn" type="button"  lay-submit="" lay-filter="addNews" >立即提交</button>
			<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
	</div>
</form>
{:jq()}
{:layui()}

<script type="text/javascript">




    layui.form.on('submit(addNews)', function(data){
          
          $.post(' ',data.field,function(res){

                if(res.code==200){

                layer.alert('发布成功',function(){

                     
                     window.location.href="{:Url('gglist',['id'=>input('pid')])}";

                });

                }


          });

        console.log(JSON.stringify(data.field));
        return false;
    });


</script>
</body>
</html>